#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2022/2/15 14:34
# @Author  : ldh

import os
import sys
import io

from basic.utils.runnerInit import CaseRunner
from test.cases.awz.awz_headlines import awz_headlines
from test.cases.awz.awz_index import awz_index
from test.cases.awz.awz_myinfo import awz_myinfo
from test.cases.awz.awz_search import awz_search
from basic.utils.Email import sendEmail
from basic.utils.path import Path
from BeautifulReport import BeautifulReport as bf

sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding = 'utf8')

current_directory = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath(os.path.dirname(current_directory) + os.path.sep + ".")
sys.path.append(root_path)

if __name__ == '__main__' :
    """
    调试通过的测试用例集合
    """

    classNameList = [awz_index, awz_myinfo, awz_search, awz_headlines]

    suite = CaseRunner.runCases(classNameList)
    run = bf(suite)  # 实例化BeautifulReport模块
    run.report(filename = 'test', report_dir = Path.getProjectPath() + "/res/report", description = '爱梧州UI自动化测试用例')
    sendEmail("爱梧州UI自动化测试", CaseRunner.caseResult(run, 0), 0)
